/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Conexao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Danimar
 */
public class ConnectionFactory {

    public static Connection getConnection() throws SQLException {
        try {
            Class.forName("org.postgres.jdbc.driver");
            Connection con = DriverManager.getConnection("jdbc:postgresql://localhost:5432/DB_Ecommerce","usuario","admin");            
            return con;
        } catch (Exception e) {
            throw new SQLException("Não foi possível criar a conexão.",e);
        }
    }
}
